<template>
  <div id="discover_head">
    <h4>发现</h4>
    <div id="nav">
      <ul>
        <li
          v-for="(item,index) in list"
          :class="{line:index==show}"
          @click="style(index)"
          :key="item.pid"
        >{{item.name}}</li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  name: "dis1",
  data() {
    return {
      list: [
        { name: "精选晒单" },
        { name: "灵感" },
        { name: "品牌" },
        { name: "实体店" },
        { name: "媒体报道" },
        { name: "设计师" }
      ],
      show: 0
    };
  },
  methods: {
    style(index) {
      this.show = index;
    }
  },
  mounted() {
    var scroll = new IScroll("#nav", { scrollX: true });
  }
};
</script>

<style  scoped>
h4 {
  margin: 0;
  margin-top: 66px;
  text-align: center;
}
#discover_head {
  background: #f9f9f9;
  height: 200px;
  overflow: hidden;
}
#nav {
  overflow: hidden;
}
#nav ul {
  width: 128%;
  /* overflow: hidden; */
  height: 84px;
  padding-left: 39px;
}
#nav ul li {
  float: left;
  margin-right: 88px;
  height: 84px;
  line-height: 84px;
}
.line {
  border-bottom: 5px solid black;
}
</style>